package com.fjc.controller;

import com.fjc.domain.ResultObject;
import com.fjc.domain.SysUser;
import com.fjc.service.SysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by fjc on 2018/5/22.
 */
@RestController
@RequestMapping("/user")
public class SysUserController {
    private final static Logger logger = LoggerFactory.getLogger(SysUserController.class);

    @Autowired
    private SysUserService sysUserService;

    @RequestMapping("/login")
    public ResultObject login(SysUser user, HttpServletRequest request){
        try{
            return sysUserService.login(user,request);
        }catch (Exception e){
            e.printStackTrace();
            return new ResultObject(-1,"失败");
        }
    }


}
